package spring_mvc.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import spring_mvc.dao.UserDao;
import spring_mvc.model.User;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public List<User> findAll(){
        List<User> userList = userDao.findALl();
        return userList;
    }

    public int save(User user){
        return userDao.save(user);
    }

    public int update(String name,String sex,int id){
        return userDao.update(name,sex,id);
    }

    public int delete(int id){
        return userDao.delete(id);
    }
}
